Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cache_dir parameter #863

Merged
merged 11 commits into from
Jan 7, 2025
Merged

Conversation

BBC-Esq
Copy link

@BBC-Esq BBC-Esq commented Dec 31, 2024

Currently, it's the program only allows you to use "huggingface," "local," or "custom" but none allow you to specify a directory where you want to download a file automatically using ```snapshot_download." This fixes that.

This pull request implements the following:

Here's a brief summary of the different options for handling model files in ChatTTS:

source="huggingface": Downloads models from HuggingFace repo to ~/.cache/huggingface

  • or to cache_dir if specified

source="local": Downloads models from HuggingFace repo to current working directory

  • or to cache_dir if specified

source="custom":

  • No change

Example Usage:

from ChatTTS import Chat

# Option 1: Using huggingface source with custom cache directory
chat = Chat()
chat.load(
    source="huggingface",
    cache_dir="path/to/your/models",
    device="cuda"
)

# Option 2: Using local source with custom cache directory 
chat = Chat()
chat.load(
    source="local",
    cache_dir="path/to/your/models",
    device="cuda"
)

# Original behavior still works without cache_dir
chat = Chat()
chat.load(
    source="huggingface",  # Will use ~/.cache/huggingface
    device="cuda"
)

@github-actions github-actions bot changed the base branch from main to dev December 31, 2024 02:15
Copy link
Member

@fumiama fumiama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fumiama fumiama added enhancement New feature or request good first issue Good for newcomers labels Jan 7, 2025
@fumiama fumiama enabled auto-merge (squash) January 7, 2025 11:00
Copy link
Member

@fumiama fumiama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And you should choose which one you want to merge. #864 or this?

@fumiama fumiama disabled auto-merge January 7, 2025 11:02
@fumiama fumiama merged commit a933b66 into 2noise:dev Jan 7, 2025
@BBC-Esq
Copy link
Author

BBC-Esq commented Jan 18, 2025

Feel free to delete the other pull request, although I do think that one is superior.

@fumiama
Copy link
Member

fumiama commented Jan 19, 2025

Feel free to delete the other pull request, although I do think that one is superior.

Well, you can edit them to resolve the conflict and I will still review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants